<div class="row">
    <div class="col-md-8" style="width: 100%;">
        <div>
            <h4>
                <a href="<?php echo URL_BASE ?>vpanel/"><i class="glyphicon glyphicon-home"></i></a> &raquo; Posts
                <?php
                if( $_SESSION['id_admon'] == 1 ) {
                    ?>
<!--                    <a class="btn btn-primary" href="vpanel/?id=add_ads">-->
<!--                        + <i class="glyphicon glyphicon-adjust"></i>  Add Post-->
<!--                    </a>-->
                <?php
                }
                ?>
            </h4>
            <hr />

        </div>

        <table cellpadding="0" cellspacing="0" border="0" class="dTable">
            <thead>
            <tr>
                <th><span class="sorting" style="display: block;"></span># ID</th>
                <th>User</th>
                <th>Title</th>
                <th>Images</th>
                <th>Status</th>
                <th>Top</th>
<!--                <th>Actions</th>-->
            </tr>
            </thead>
            <tbody>
            <?php
            foreach ( $this->posts as $row ) {
//                echo '<pre>';
//                print_r($row);
//                echo '</pre>';

                ?>
                <tr>
                    <td><?php echo  $row['postId'] ?></td>
                    <td><?php echo  $row['username'] ?></td>
                    <td class="statusTd"><?php echo ucfirst( $row['postDetail'] ) ?></td>
                    <td>
                        <?php if($row['postPhoto']!=''){ ?>
                            <img style="width: 60px" src="./upload/<?php echo  $row['postPhoto'] ?>">
                        <?php } ?>
                    </td>
                    <td>
                        <?php if($row['postStatus'] == 1){ echo '<span style="float:left;color:white; margin: 10px; background: darkgreen; padding: 10px" >Active</span>'; }else { echo '<span style="float:left;color:white; margin: 10px; background: red; padding: 10px" >deleted</span>'; }?>
                    </td>
                    <td>
                        <input type="checkbox" class="btn-checktop" value="<?php

                        if($row['postTop'] == 1)
                            echo '0';
                        else
                            echo 1;
                        ?>" data-post-id="<?php echo $row['postId'] ?>" <?php
                            if($row['postTop'] == 1)
                                echo 'checked';
                        ?>

                            >
                    </td>
<!--                    <td class="statusTd">-->
<!--                        --><?php //if( $row['id'] != 1 && $_SESSION['id_admon'] == 1 ) : ?>
<!--                            <a title="Edit" href="/vpanel/?edit_ads=--><?php //echo $row['id'] ?><!--" data-id="--><?php //echo $row['id'] ?><!--" id="edit">-->
<!--                                <i class="glyphicon glyphicon-edit"></i>-->
<!--                            </a>-->
<!--                        --><?php
//                        else:
//                            ?>
<!--                            --->
<!--                        --><?php //endif; ?>
<!--                    </td>-->
                </tr>
            <?php } ?>

            </tbody>
        </table>

    </div>
</div><!-- End row -->



